from django.apps import AppConfig


class CmdbConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'cmdb'
    verbose_name = 'CMDB资产管理'

    def ready(self):
        """应用启动时的初始化"""
        # 启动主机连通性监控
        try:
            from .tasks import start_connectivity_monitoring
            start_connectivity_monitoring()
            print("✅ 主机连通性监控已启动")
        except Exception as e:
            print(f"❌ 启动主机连通性监控失败: {e}")
            import traceback
            traceback.print_exc()
